//
//  YYSetPassword.m
//  drivingSchool
//
//  Created by 子yu 刘 on 2018/8/13.
//  Copyright © 2018年 子yu 刘. All rights reserved.
//

#import "YYSetPassword.h"

@interface YYSetPassword ()

@end

@implementation YYSetPassword

- (void)viewDidLoad {
    [super viewDidLoad];
    self.lbPhone.text = [UserCenterData sharedInstance].iphone;
}

- (IBAction)sendCode:(id)sender {
    [self.btnCode startTime];
    [RequestOperationManager sendCode_action:@"changePassword" phone: [UserCenterData sharedInstance].iphone Success:^(id result) {
        if (DEF_REQ_SUCCESS) {
            [AlertUtil alertMessage:@"验证码已发送到您的手机"];
        }
        
    } failture:^(NSError *error) {
        
    }];
}

- (IBAction)corfirme:(id)sender {
    [RequestOperationManager changePassword_iphone:[UserCenterData sharedInstance].iphone password:self.tfPassword1.text code:self.tfCode.text success:^(id result) {
        if (DEF_REQ_SUCCESS) {
            [AlertUtil alertMessage:@"密码设置成功"];
            [self.navigationController popViewControllerAnimated:YES];
        }
        
    } failture:^(NSError *error) {
      
        
    }];
}


@end
